package com.okami.controller;

//import org.redisson.api.RedissonClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.web.bind.annotation.GetMapping;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * @author: TanJingyu
 * @create: 2021-01-27 10:46
 **/
@RestController
@RequestMapping("/redis")
public class RedisController {
//    @Autowired
//    private RedisTemplate<String, String> redisTemplate;
//    @Autowired
//    private RedissonClient redissonClient;
//
//    @GetMapping
//    public void get() {
//        Boolean result = redisTemplate.opsForValue().setIfAbsent("lock", UUID.randomUUID().toString(), 1, TimeUnit.MINUTES);
//    }
}
